//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    find_message : ''
   
  },
  
  // 点击查询
  bindquery:function (e) {
    var postid = this.data.orderId.detail['value']
    wx.navigateTo({
      url: '../../pages/detail/detail?postid=' + postid
    })
  },
  inputName:function(e){
    console.log(e)
    this.setData({
      name : e.detail['value']
    })
  },
  inputPhone:function(e){
    console.log(e)
    this.setData({
      phone : e.detail['value']
    })
  },
  inputOrder:function(e){
    console.log(e)
    this.setData({
      order : e.detail['value']
    })
  },
  bindsubmit: function (e) {
    var that = this
    console.log(e)
    wx.request({
      url: app.globalData.api_url + '/Courier/add.php', //仅为示例，并非真实的接口地址
      data: {
        name: that.data.name,
        phone: that.data.phone,
        order:that.data.order
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success(res) {
        console.log(res.data)
        that.setData({
          submitCode:res.data['code']
        })
      }
    })
  },
  hideModal(e) {
    this.setData({
      submitCode: 0
    })
  },
  bindfind(e){
    var that = this
   
        wx.navigateTo({
          url: "../../pages/find/find?name=" + that.data.name + "&phone=" + that.data.phone + "&order=" + that.data.order
        });
      
  },
  onLoad: function (options) {
    this.setData({
      name : '',
      phone : '',
      order : ''
    })
  }
})
